package com.wusongti.performance.model.vo;

import java.io.Serializable;
import java.util.List;

/**
 * @ClassName: CommonResponseVO
 * @author: wust
 * @date: 2022/04/28 17:00
 * @Description: 通用返回对象
 */
public class CommonResponseVO<T, E> implements Serializable {
    public static final String INFO_SUCCESS = "SUCCESS";
    public static final String INFO_ERROR = "ERROR";
    public static final String INFO_WARNING = "WARNING";
    private static final long serialVersionUID = -4163766286277670113L;
    private String code;

    private String flag;

    private String message;

    private List<T> lstDto;

    private List<E> lstDetailDto;

    private Object obj;

    public CommonResponseVO() {
        this.setFlag(CommonResponseVO.INFO_SUCCESS);
        this.setMessage("成功");
    }

    public boolean isSuccess() {
        if (CommonResponseVO.INFO_SUCCESS.equals(this.getFlag())) {
            return true;
        }
        return false;
    }

    public String getCode() {
        return code;
    }

    public void setCode(String code) {
        this.code = code;
    }

    public String getFlag() {
        return flag;
    }

    public void setFlag(String flag) {
        this.flag = flag;
    }

    public String getMessage() {
        return message;
    }

    public void setMessage(String message) {
        this.message = message;
    }

    public List<T> getLstDto() {
        return lstDto;
    }

    public void setLstDto(List<T> lstDto) {
        this.lstDto = lstDto;
    }

    public List<E> getLstDetailDto() {
        return lstDetailDto;
    }

    public void setLstDetailDto(List<E> lstDetailDto) {
        this.lstDetailDto = lstDetailDto;
    }

    public Object getObj() {
        return obj;
    }

    public void setObj(Object obj) {
        this.obj = obj;
    }
}
